package com.kfd.demo.controller;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.kfd.demo.entity.Reqs;
import com.kfd.demo.service.TheMunuServe;
import com.kfd.demo.util.JsonConvertUtil;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@CrossOrigin(origins = "*")
public class MenuController {

    //集合查询
    @Autowired
    TheMunuServe theMunuServe;


//    查询菜单以及数据
    @ResponseBody
    @RequestMapping(value = "/TheMenu") //, produces = "application/json;charset=UTF-8"
    public Reqs TheMenu() throws JsonProcessingException {
//        System.out.println(theMunuServe.getRightMenuData());
        System.out.println("获取数据-----");
        return new Reqs(200, "",theMunuServe.getRightMenuData());
    }

    ;
}
